Skip to main content
POST
/
v1
/
promotion-codes
Create promotion code
curl --request POST \
  --url https://api.hyperline.co/v1/promotion-codes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "code": "PROMO123",
  "coupon_id": "cou_DKL4Xcb5VSa8CQ",
  "customer_id": "cus_DKL4Xcb5VSa8CQ",
  "plan_id": "plan_DKL4Xcb5VSa8CQ",
  "product_id": "itm_DKL4Xcb5VSa8CQ",
  "expires_at": "2021-01-01T00:00:00.000Z",
  "max_redemptions": 10,
  "current_redemptions": 0,
  "duration_count": 1,
  "duration_period": "months",
  "only_for_first_time_order": false
}'
{
  "id": "promo_DKL4Xcb5VSa8CQ",
  "code": "PROMO123",
  "coupon_id": "cou_DKL4Xcb5VSa8CQ",
  "client_id": "cli_DKL4Xcb5VSa8CQ",
  "customer_id": "cus_DKL4Xcb5VSa8CQ",
  "plan_id": "plan_DKL4Xcb5VSa8CQ",
  "product_id": "itm_DKL4Xcb5VSa8CQ",
  "created_at": "2021-01-01T00:00:00.000Z",
  "updated_at": "2021-01-01T00:00:00.000Z",
  "expires_at": "2021-01-01T00:00:00.000Z",
  "max_redemptions": 10,
  "current_redemptions": 0,
  "duration_count": 1,
  "duration_period": "months",
  "only_for_first_time_order": false
}

Authorizations

Authorization
string
header
required

Body

application/json
code
string
required
Example:
coupon_id
string
required
Example:
customer_id
string | null
Example:
plan_id
string | null
Example:
product_id
string | null
Example:
expires_at
string<date-time> | null
Example:
max_redemptions
number | null
Example:
current_redemptions
integer | null
Example:
duration_count
integer | null
Required range: x >= 1
Example:
duration_period
enum<string> | null
Available options:
once,
days,
weeks,
months,
years
Example:
only_for_first_time_order
boolean | null
default:false
Example:

Response

201 - application/json
id
string
required
Example:
code
string
required
Example:
coupon_id
string
required
Example:
client_id
string
required
Example:
customer_id
string | null
required
Example:
plan_id
string | null
required
Example:
product_id
string | null
required
Example:
created_at
string<date-time>
required
Example:
updated_at
string<date-time>
required
Example:
expires_at
string<date-time> | null
required
Example:
max_redemptions
number | null
required
Example:
current_redemptions
number | null
required
Example:
duration_count
number | null
required
Example:
duration_period
enum<string> | null
required
Available options:
once,
days,
weeks,
months,
years
Example:
only_for_first_time_order
boolean | null
required
Example: